package com.cv.audit.dal.mapper.video;

import com.cv.audit.controller.audit.video.vo.AuditVideoLogPageReqVO;
import com.cv.audit.controller.audit.video.vo.AuditVideoLogRespVO;
import com.cv.audit.dal.dataobject.video.AuditVideoLogDO;
import com.cv.framework.common.pojo.PageResult;
import com.cv.framework.mybatis.core.mapper.BaseMapperX;
import com.cv.framework.mybatis.core.query.MPJLambdaWrapperX;
import com.cv.framework.security.core.utils.SecurityFrameworkUtil;
import org.apache.ibatis.annotations.Mapper;

/**
 * 视频审核日志数据层
 *
 * @author Charles_XDXD
 */
@Mapper
public interface AuditVideoLogMapper extends BaseMapperX<AuditVideoLogDO> {

    default PageResult<AuditVideoLogRespVO> getPage(AuditVideoLogPageReqVO reqVO) {
        return selectJoinPage(reqVO, AuditVideoLogRespVO.class, new MPJLambdaWrapperX<AuditVideoLogDO>()
                .selectAll(AuditVideoLogDO.class)
                .eqIfPresent(AuditVideoLogDO::getUserId, SecurityFrameworkUtil.getLoginUserId())
                .betweenIfPresent(AuditVideoLogDO::getCreateTime, reqVO.getRecordTime())
        );
    }

}
